#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>

int main(int argc, char *argv[])
{
	int fp1, fp2;

	printf("stdin is \t%d\n", fileno(stdin));
	printf("stdout is \t%d\n", fileno(stdout));
	printf("stderr si \t%d\n", fileno(stderr));
	printf("1 success\n");
	if((fp1 = open("./test", O_WRONLY)) == -1) {
		perror("open");
		exit(EXIT_FAILURE);
	}
	printf("2 success\n");
	if((fp2 = open("test2", O_WRONLY)) == -1) {
		perror("open");
		exit(EXIT_FAILURE);
	}

	printf("test file is \t%d\n", fp1);
	printf("test2 file is \t%d\n", fp2);

	close(fp1);
	close(fp2);
	return 0;
}
